from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer, String, DateTime
import datetime
from db import Base

class User(Base):
    __tablename__ = "users"

    id = Column(Integer, primary_key = True)
    name = Column(String(50))
    realname = Column(String(50))
    password = Column(String(50))

    create_time = Column(DateTime, default=datetime.datetime.now)

    def __init__(self, name, realname, password):
        self.name = name
        self.realname = realname
        self.password = password

    def __repr__(self):
        return '<User %r>' % (self.name)
